{template modoer_header}
<script type="text/javascript">
$(document).ready(function() {
    //弹出浮动层
    $(".J_prowerfloat").powerFloat({reverseSharp:true});
});
function coupon_effect(couponid) {
	$.post(Url('coupon/detail/do/effect/id/'+couponid), 
	{ effect:'effect1',in_ajax:1 },
	function(result) {
        if(result == null) {
			alert('信息读取失败，可能网络忙碌，请稍后尝试。');
        } else if (result.match(/\{\s+caption:".*",message:".*".*\s*\}/)) {
            myAlert(result);
		} else if (result == 'OK') {
            $('#btn_effect1').html('对我有用!');
        } 
	});
}
</script>
<div id="body">

    <div class="link_path">
        <em>
            <!--{loop $links $i $link}-->
            {if $i}<span class="xsplit"> | </span>{/if}
            <a href="$link[url]"{if $link[flag]=='coupon'} style="color:#ff6600;"{/if}>$link[title]</a>
            <!--{/loop}-->
        </em>
        <a href="{url modoer/index}">$_CITY[name]</a>&nbsp;&raquo;&nbsp;{print implode('&nbsp;&raquo;&nbsp;', $urlpath)}
        <span class="font_3">(编号：$couponid)</span>
    </div>

    <div class="mainrail">

        <div id="coupon_left">

            <div class="detail rail-border-3">
                <h2 class="subject">[{$category[$detail[catid]][name]}]&nbsp;$detail[subject]</h2>
                <div class="info">
                    发布时间：{date $detail[dateline],'Y-m-d'}&nbsp;
                    人气：$detail[pageview]&nbsp;
                    打印：$detail[prints]&nbsp;
                    {if $detail[sms_text] && $MOD[sendsms] && check_module('sms')}
                    短信发送：$detail[send_num]&nbsp;
                    {/if}
                    评论：$detail[comments]&nbsp;
                    <span class="xsplit">|</span>
                    <a class="J_prowerfloat" href="javascript:;" id="qrcode_image" rel="qrcode_box"><span class="icomoon icon-qrcode" title="二维码"></span>二维码</a>
                    <div id="qrcode_box" style="border:1px solid #ddd;display:none;"><img src="{print get_qrcode(url("coupon/detail/id/$couponid",'',1))}"></div>
                    <!--{if $_CFG[sharecode]}-->
                    <a class="J_prowerfloat" href="javascript:;" id="sharecode" rel="sharecode_box"><span class="icomoon icon-newtab" title="分享"></span>分享</a>
                        <div class="sharecode_box" id="sharecode_box">
                            {$_CFG[sharecode]}
                        </div>
                    <!--{/if}-->
                </div>
                <ul class="des">
                    <li>有效时间：{date $detail[starttime],'Y-m-d'} ~ {date $detail[endtime],'Y-m-d'}</li>
                    <li>优惠说明：$detail[des]</li>
                </ul>
                <div class="print">
                    <a class="abtn1" href="{url coupon/print/id/$couponid}"><span>打印此券</span></a>
                    {if $detail[sms_text] && $MOD[sendsms] && check_module('sms')}
                    <a class="abtn1" href="javascript:void(0);" onclick="send_coupon_sms($couponid);"><span>发送到手机</span></a>
                    {/if}
                    <span id="btn_effect1"><a class="abtn2" href="javascript:coupon_effect($couponid);"><span>对我有用</span></a></span>
                    <div class="clear"></div>
                </div>
                <div class="content">
                    <div style="text-align:center;"><img src="{URLROOT}/$detail[picture]" alt="$detail[subject]" /></div>
                    <div class="content-des">$detail[content]</div>
                </div>

            </div>

            <!--{hook 'load_comment', $comment_cfg}-->

        </div>

        <div id="coupon_right">
            <div class="mainrail rail-border-3">
                <!--{template item_subject_side}-->
                <!--{eval $model = $I->get_model($subject[catid], 1);}-->
                <!--{if $model[usearea]}-->
                <div class="mainrail mt10 text_center">
                    <!--{eval $show_map = $subject[mappoint] ? 1 : 0;}-->
                    <script type="text/javascript">
                    function show_bigmap() {
                        var src = "{url index/map/width/600/height/400/title/$fullname/p/$subject[mappoint]/show/$show_map}";
                        var html = '<iframe src="' + src + '" frameborder="0" scrolling="no" width="100%" height="400" id="ifupmap_map"></iframe>';
                        dlgOpen('查看大图', html, 600, 450);
                    }
                    </script>
                    <a href="javascript:;"onclick="show_bigmap()">
                        <img src="{print:modoer map_static_image(size/245x245/title/$fullname/p/$subject[mappoint]/show/$show_map)}" alt="$fullname" title="$fullname" />
                    </a>
                    <div style="text-align:center;padding:2px 0;color:#555;">
                        <!--{if !$subject['mappoint']}-->
                        <a href="javascript:post_map($subject[sid], $subject[pid]);">地图未标注，我来标注</a>
                        <!--{else}-->
                        <span class="icomoon icon-map"></span><a href="javascript:show_bigmap();">查看大图</a>&nbsp;
                        <span class="icomoon icon-location"></span><a href="javascript:post_map($subject[sid], $subject[pid]);">报错</a>
                        <!--{/if}-->
                    </div>
                </div>
                <!--{/if}-->
                <div class="mainrail rail-h-bt-3">
                    <em><a href="{url coupon/list/sid/$subject[sid]}">更多&nbsp;&raquo;</a></em>
                    <h4 class="rail-h-2">其他优惠券</h4>
                    <ul class="rail-list">
                        {get:coupon val=list_new(sid/$val[sid]/row/10)}
                        <li><cite>{date $val[dateline],'m-d'}</cite><a href="{url coupon/detail/id/$val[couponid]}" title="$val[subject]">{sublen $val[subject],23}</a></li>
                        {/get}
                    </ul>
                </div>
            </div>
        </div>
        <div class="clear"></div>
    </div>

</div>
<!--{eval footer();}-->